<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">

<head>
    <th:block th:include="common/common_head :: commonHeader('采购表更记录')"/>
    <link rel="stylesheet" th:href="@{/static/js/plugins/jquery-layout/jquery.layout-latest.css}">
</head>

<body class="gray-bg">

<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-condition">
            <form id="changeListForm" th:action="@{/purchaseChangeRecord/list}" class="form-inline">
                <div class="select-list">
                    <ul>
                        <li class="col-sm-3">
                            <label>物料号: </label>
                            <input type="text" name="materialCode"/>
                        </li>
                        <li class="col-sm-3">
                            <label>采购订单号：</label>
                            <input type="text" name="purchRequestCode"/>
                        </li>
                       <!-- <li class="col-sm-3">
                            <label>行项目：</label>
                            <input type="text" name="purchRequestItemCode"/>
                        </li>-->
                        <li class="col-sm-3">
                            <div>
                                <label>申请人：</label>
                                <input type="text" name="creator"/>
                            </div>
                        </li>
                        <li class="col-sm-3">
                            <div>
                                <label>申请日期(起)：</label>
                                <input type="text" id="startDate" name="startDate" autocomplete="off" />
                            </div>
                        </li>
                        <li class="col-sm-3">
                            <div>
                                <label>申请日期(止)：</label>
                                <input type="text" name="endDate" id="endDate" autocomplete="off"/>
                            </div>
                        </li>

                        <li class="col-sm-3">
                            <button id="changeListSearchBtn" type="button"
                                    class="btn btn-primary btn-rounded btn-sm"><i class="fa fa-search"></i>&nbsp;搜索
                            </button>
                            <button class="btn btn-warning btn-rounded btn-sm" type="reset"><i class="fa fa-eraser"></i>&nbsp;重置
                            </button>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-info order-table">
            <div>
                <table id="changeList" data-mobile-responsive="true">
                </table>
            </div>
        </div>
    </div>
</div>
<!-- 引入公共js -->
<div th:include="common/onload_js :: onloadJS"></div>
<script type="text/javascript" th:src="@{/static/js/plugins/jquery-layout/jquery.layout-latest.js}"></script>

<!-- Page-Level Scripts -->
<script type="text/javascript">

    //面向对象
    var searcherBS = Searcher.createBS('#changeList',
        [
            {checkbox: true},
            {title: '变更单号', field: 'changeCode'},
            {title: '采购订单号', field: 'purchRequestCode'},
            {title: '行项目', field: 'purchRequestItemCode'},
            {title: '物料号', field: 'materialCode'},
            {title: '物料描述', field: 'materialDesc'},
            {title: '原申请数量 ', field: 'formerApplyQty'},
            {title: '变更数量', field: 'applyQty'},
            {title: '原交期', field: 'formerDeliveryDate'},
            {title: '变更交期', field: 'deliveryDate'},
            {title: '变更原因', field: 'reason'},
            {title: '申请人', field: 'creator'},
            {title: '申请日期', field: 'applyDate'}
        ]
    );

    //刷新数据
    function refresh() {
        searcherBS.refresh();
    }


    $(function () {
        // 初始化时间插件
        laydate.render({elem: '#endDate'});
        laydate.render({elem: '#startDate'});

    });

    initDictDataSel();//初始化所有字典数据


</script>
</body>
</html>